package com.chiyi.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.chiyi.bean.TUser;
import com.chiyi.mapper.TUserMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @date 2021/5/13 17:40
 */
@RestController
@Api(tags = "web")
public class WebController {

    @Resource
    private TUserMapper tUserMapper;

    @ApiOperation("work")
    @GetMapping("/work")
    public String work() {
        return "success";
    }

    @ApiOperation("获取全部用户")
    @GetMapping("/getAllUser")
    public List<TUser> getAllUser() {
        QueryWrapper qw = new QueryWrapper();
        List<TUser> list = tUserMapper.selectList(qw);
        return list;
    }
}
